<?php
/**
 * Description of _tablaDatos
 * Genera una tabla que contiene los datos mensuales de las medidas antropométricas
 * @author Mauricio
 */
$institucion = new Institucion();
$modelInst = $institucion->findByPk((int)$ninio->institucion_id);
?>
<center><h2><?php echo Yii::t('AweCrud.app', 'Histórico ') ?></h2></center>

<table id="tablaDatosAntropometricos" class="table table-bordered table-striped compact row-border">
    <thead>
        <tr>
               <th colspan="62" style="text-align: center"><?php echo ($ninio->genero=="FEMENINO"?"Niña: ":"Niño: ") . $ninio->nombre_completo?></th>
        </tr>
    </thead>
    <tbody class="row-fluid">
        <?php
        $contColumn = 0;
        echo "<tr>";
        echo "<td>";
        echo "<b>Edad</b>";
        echo "</td>";
        foreach ($datosTabla as $colum) {
            if ($contColumn < 30) {
                echo "<td style='text-align: center'>";
                echo $colum[0];
                echo "</td>";
            }
            $contColumn++;
        }
        $contColumn = 0;
        echo "<td>";
        echo "<b>Edad</b>";
        echo "</td>";
        echo "</tr>";

        echo "<tr>";
        echo "<td>";
        echo "<b>IMC (kg/m<sup>2</sup>)</b>";
        echo "</td>";
        foreach ($datosTabla as $colum) {
            if ($contColumn < 30) {
                echo "<td style='text-align: center'>";
                echo $colum[1][0];
                echo "</td>";
            }
            $contColumn++;
        }
        $contColumn = 0;
        echo "<td>";
        echo "<b>IMC (kg/m<sup>2</sup>)</b>";
        echo "</td>";
        echo "</tr>";

        echo "<tr>";
        echo "<td>";
        echo "<b>Talla (cm)</b>";
        echo "</td>";
        foreach ($datosTabla as $colum) {
            if ($contColumn < 30) {
                echo "<td style='text-align: center'>";
                echo $colum[2][0];
                echo "</td>";
            }
            $contColumn++;
        }
        $contColumn = 0;
        echo "<td>";
        echo "<b>Talla (cm)</b>";
        echo "</td>";
        echo "</tr>";

        echo "<tr>";
        echo "<td>";
        echo "<b>Peso (kg)</b>";
        echo "</td>";
        foreach ($datosTabla as $colum) {
            if ($contColumn < 30) {
                echo "<td style='text-align: center'>";
                echo $colum[3][0];
                echo "</td>";
            }
            $contColumn++;
        }
        $contColumn = 0;
        echo "<td>";
        echo "<b>Peso (kg)</b>";
        echo "</td>";
        echo "</tr>";
        ?>
    </tbody>
</table>
<table id="tablaDatosAntropometricos" class="table table-bordered table-striped compact row-border">
    <thead>
        <tr>
               <th colspan="62" style="text-align: center"><?php echo ($ninio->genero=="FEMENINO"?"Niña: ":"Niño: ") . $ninio->nombre_completo?></th>
        </tr>
    </thead>
    <tbody class="row-fluid">
        <?php
        $contColumn = 0;
        echo "<tr>";
        echo "<td>";
        echo "<b>Edad</b>";
        echo "</td>";
        foreach ($datosTabla as $colum) {
            if ($contColumn > 29) {
                echo "<td style='text-align: center'>";
                echo $colum[0];
                echo "</td>";
            }
            $contColumn++;
        }
        $contColumn = 0;
        echo "<td>";
        echo "<b>Edad</b>";
        echo "</td>";
        echo "</tr>";

        echo "<tr>";
        echo "<td>";
        echo "<b>IMC (kg/m<sup>2</sup>)</b>";
        echo "</td>";
        foreach ($datosTabla as $colum) {
            if ($contColumn > 29) {
                echo "<td style='text-align: center'>";
                echo $colum[1][0];
                echo "</td>";
            }
            $contColumn++;
        }
        $contColumn = 0;
        echo "<td>";
        echo "<b>IMC (kg/m<sup>2</sup>)</b>";
        echo "</td>";
        echo "</tr>";

        echo "<tr>";
        echo "<td>";
        echo "<b>Talla (cm)</b>";
        echo "</td>";
        foreach ($datosTabla as $colum) {
            if ($contColumn > 29) {
                echo "<td style='text-align: center'>";
                echo $colum[2][0];
                echo "</td>";
            }
            $contColumn++;
        }
        $contColumn = 0;
        echo "<td>";
        echo "<b>Talla (cm)</b>";
        echo "</td>";
        echo "</tr>";

        echo "<tr>";
        echo "<td>";
        echo "<b>Peso (kg)</b>";
        echo "</td>";
        foreach ($datosTabla as $colum) {
            if ($contColumn > 29) {
                echo "<td style='text-align: center'>";
                echo $colum[3][0];
                echo "</td>";
            }
            $contColumn++;
        }
        $contColumn = 0;
        echo "<td>";
        echo "<b>Peso (kg)</b>";
        echo "</td>";
        echo "</tr>";
        ?>
    </tbody>
</table>

